/**
 * Player. 
 * by Alvaro Lopez and Juan Baquero
 * 
 * Create a Player of unPlayer put the URL of Youtube Video
 * in the Constructor or in the metod "loadVideo()".
 *
 * The size of the video depends on the specific youtube video,
 * according to the following codes can be placed on the constructor 
 * of the class, otherwise the player use the default size
 * 
 * Size:
 * 
 * 0   ->    Default Size
 * 5   ->    240p //NO SOUND
 * 34  ->    340p
 * 35  ->    480p
 * 22  ->    720p
 * 37  ->   1080p
 *
 */

import unplayer.videoplayer.VideoPlayer;
import unplayer.youtubeplayer.VideoPlayerYoutube;
import codeanticode.gsvideo.GSMovie;


void setup() {
  

  
  size(800, 600, P2D);
  player = new VideoPlayerYoutube(this,"http://www.youtube.com/watch?v=rJrh0RipoVo");  // Default
  //player = new VideoPlayerYoutube(this,"http://www.youtube.com/watch?v=rJrh0RipoVo",35); // 480p
}

void movieEvent(GSMovie myMovie) {
  myMovie.read();
}

void draw() {
  background(255);
  player.video(0,0);
}

VideoPlayer player;
